Skip to content

Conversation

@brooksprumo
Copy link

@brooksprumo brooksprumo commented Apr 16, 2025

Problem

AccountsDb::scan_account_storage() still loads account data in its back-end impl, even when we specify ScanAccountStorageData::NoData.

Summary of Changes

Following on from #5840, we can now add a back-end method to not load the account data when scanning a storage. This PR adds AccountsFile::scan_accounts_without_data().

@brooksprumo brooksprumo self-assigned this Apr 16, 2025
ScanAccountStorageData::NoData => {
storage.scan_accounts(|account| {
let account_without_data = StoredAccountInfoWithoutData::new_from(&account);
storage.scan_accounts_without_data(|account_without_data| {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the main change. We now do not load account data if scan_account_storage_data is NoData 🎉

mut callback: impl for<'local> FnMut(StoredAccountInfoWithoutData<'local>),
) -> TieredStorageResult<()> {
// Note, this should be reimplemented to not read account data
self.scan_accounts(|stored_account| {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can fix this Tiered Storage implementation later when we need to. I didn't think it was necessary for this PR though.

@brooksprumo brooksprumo marked this pull request as ready for review April 16, 2025 18:13
Copy link

@cpubot cpubot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link

@HaoranYi HaoranYi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 53.33333% with 21 lines in your changes missing coverage. Please review.

Project coverage is 83.0%. Comparing base (a829c44) to head (12faf21).
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##           master    #5849     +/-   ##
=========================================
- Coverage    83.0%    83.0%   -0.1%     
=========================================
  Files         828      828             
  Lines      375847   375890     +43     
=========================================
+ Hits       312018   312023      +5     
- Misses      63829    63867     +38     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@brooksprumo brooksprumo merged commit 44bd7c7 into anza-xyz:master Apr 16, 2025
30 checks passed
@brooksprumo brooksprumo deleted the accounts/scan-accounts-without-data branch April 16, 2025 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants